package com.tingyuge.base.structrue.hash;

/**
 * @Created by xiaodao
 */
public class Solution387 {

    public int firstUniqChar(String s){
        int[] arr = new int[26];
        for (int i = 0; i <s.length() ; i++) {
           arr[s.charAt(i) - 'a']++ ;

        }
        for (int i = 0; i < s.length(); i++) {
            if(arr[s.charAt(i) - 'a'] == 1){
             return -1;
            }
            
        }
        return -1;
    }


    public static void main(String[] args) {
        System.out.println('y'-'a');
    }
}
